package com.xcw.bos.web.action;

import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.xcw.bos.domain.Role;
import com.xcw.bos.web.action.base.BaseAction;
/**
 * 角色操作Action
 * @author xcw
 *
 */
@Controller
@Scope("prototype")
public class RoleAction extends BaseAction<Role> {
    private String functionIds;//权限id
    //保存角色
    public String save(){
    	roleService.save(model, functionIds);
    	return "list";
    }
    //查询所有角色，返回json数据
    public String list(){
    	List<Role> list = roleService.findAll();
    	String[] excudes = new String[]{"users","functions"};
    	this.writeList2Json(excudes, list);
    	return NONE;
    } 
    
    public void setFunctionIds(String functionIds){
    	this.functionIds = functionIds;
    }
}
